package com.wjs.controller;

import com.wjs.entity.User;
import com.wjs.service.UserService;
import com.wjs.service.impl.UserServiceImpl;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/user")
public class UserController {
    private UserService service=new UserServiceImpl();
    @RequestMapping("/login")
    public String login(User user) {
        User user1 = service.selectByNameAndPwd(user);
        boolean boo=user1!=null;
        if (user1!=null){
            return "redirect:/tea/selectAll.do";
        }else {
            return "redirect:/login.jsp";
        }

    }
}
